package com.resign.carl.proxy.service.impl;

import com.resign.carl.proxy.service.MyRemote;

import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 * Created by carl.zhao on 2016/6/20.
 */
public class MyRemoteImpl extends UnicastRemoteObject implements MyRemote {

    public MyRemoteImpl() throws RemoteException{

    }
    @Override
    public String sayHello() throws RemoteException {
        return "server says, 'Hey'";
    }

    public static void main(String[] args) {
        try {
            MyRemote service = new MyRemoteImpl();
            Naming.bind("RemoteHello", service);
        } catch (Exception ex){
            ex.printStackTrace();
        }
    }
}
